<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>		
		<link rel="stylesheet" type="text/css" href="../css/register.css"/>
		<link rel="stylesheet" type="text/css" href="../css/jquery.idcode.css"/>
		<style type="text/css">
			
		</style>		
	</head>
	<body>
		<div id="box">
			<div id="rap">
			<header>
				<h1 class="c1 fl"><a href="/"><img src="../img/logo.png" alt="麦考林"></a></h1>
			</header>
			<div id="login">
				<p>已有麦考林账号 ? 
					<a href="user.php?act=login" title="立即登录">立即登录</a>
					<a href="user.php?act=register3" title="贵宾激活" class="fr">贵宾激活</a>
				</p>
				<form id="myform" enctype="application/x-www-form-urlencoded">
					<label class="text">
						<i></i>
						<input type="text" placeholder="请输入手机号" id="phone" name="phone" value="18895337330"/>
						<div class="tishi"></div>
					</label>
					
					<label class="text yan">
                        <input type="text" id="Txtidcode"  placeholder="验证码">
                       	<span id="idcode"></span>
                       	<div class="tishi"></div>
					</label>
					
					<label class="text xinxi aa">
						<i></i>
						<input type="text" placeholder="昵称"  value="青旅" name="uname" id="uname"/>						
						<div class="tishi"></div>																				
					</label>
					<label class="text pwd aa">
						<i></i>
						<input type="password" id="upwd" placeholder="密码" name="upwd" value="111"/>
						<div class="tishi"></div>
					</label>
					<label class="text yespwd aa">
						<i></i>
						<input type="password" placeholder="确认密码" value="111"/>
						<div class="tishi"></div>
					</label>
					<div class="bb">
						<input type="checkbox" name="" id="checkbox" value="" />
						<p>我已阅读并同意<a href="#">《麦考林用户注册协议》</a></p>
					</div>
					<input type="button" name="" id="btn" value="注&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;册" />
				</form>				
			</div>
		</div>
		
		</div>
		
		<footer>			
				<ul id="foot-top">
					<li>
						<a>	
							<em></em>
							<span id="">100%正品保证</span>															
						</a>
					</li>
					<li>
						<a>
							<em style="background-position: 0 -106px"></em>
							<span id="">专业在线客服</span>															
						</a>
					</li>
					<li>
						<a>
							<em  style="background-position: 0 -212px"></em>
							<span id="">满99元包邮</span>															
						</a>
					</li>
				</ul>
				<div class="fr">
		            <dl>
		                <dt>新手指南</dt>               
		                <dd><a href="#" target="_blank" title="新会员注册">新会员注册</a></dd>
		                <dd><a href="#" target="_blank" title="购物演示">购物演示</a></dd>
		                <dd><a href="#" target="_blank" title="常见问题">常见问题</a></dd>
		            </dl>
		            <dl>
		                <dt>付款方式</dt>
		                <dd><a href="#" target="_blank" title="银行卡支付">银行卡支付</a></dd>
		                <dd><a href="#" target="_blank" title="支付宝支付">支付宝支付</a></dd>
		                <dd><a href="#" target="_blank" title="余额支付">余额支付</a></dd>
		            </dl>
		            <dl>
		                <dt>售后服务</dt>
		                <dd><a href="#" target="_blank" title="退换货政策">退换货政策</a></dd>
		                <dd><a href="#" target="_blank" title="退换货流程">退换货流程</a></dd>
		                <dd><a href="#" target="_blank" title="退款流程">退款流程</a></dd>
		                <dd><a href="#" target="_blank" title="发票说明">发票说明</a></dd>
		            </dl>
		            <dl>
		                <dt>特色服务</dt>
		                <dd><a href="#" target="_blank" title="贵宾专区">贵宾专区</a></dd>
		                <!--<dd><a href="/book/" target="_blank" title="电子刊物">电子刊物</a></dd>-->
		                <dd><a style="cursor:pointer;"  title="在线客服">在线客服</a></dd>
		            </dl>
		             <dl>
		                <dt>麦考林生活家</dt>
		                <dd><img src="../img/dingyue.jpg" alt="麦考林生活家" width="100" height="100"></dd>
		            </dl>
		             <dl class="last">
		                <dt>麦考林服务号</dt>
		                <dd style="margin-left:8px"><img src="../img/fuwu.jpg" alt="麦考林服务号" width="100" height="100"></dd>
		            </dl>
        		</div>
				<div class="foot-b">
					<ul class="clearfix">
	                    <li class="first"><a href="#" rel="nofollow">  关于麦考林</a> </li>
	                    <li><a href="#" target="_blank" rel="nofollow">INVESTOR RELATIONS</a></li>
	                    <li><a href="#" rel="nofollow">联系我们 </a></li>	                    
	                    <li><a href="#" rel="nofollow">服务中心</a></li>
	                    <li class="last"><a href="#" rel="nofollow">加入我们 </a></li>                    
                	</ul>
                	<p><a href="#" target="_blank"><img src="../img/newicon.png" alt="上海工商" width="26" height="28"></a> 沪ICP备05003606号Copyright©2011-2015 MecoxLane Inc. All Rights Reserved</p>
				</div>							
		</footer>
		<div class="foot-bottom">
			<a target="_blank" href="#"><img src="../img/xfwqNew.jpg"></a>　　
			<a target="_blank" href="#"><img src="../img/evaluate.jpg"></a>						　　
			<a target="_blank" href="#"><img src="../img/beian.png">沪公网安备 31010402000234号</a>											
		</div>
	</body>
</html>
<script src="../js/jquery-1.12.3.min.js"></script>
<script src="../js/jquery.idcode.js"></script>
<script src="../js/tronke.Cookie.js"></script>

<script type="text/javascript">

var inputs=document.getElementsByTagName("input");

	var reg1=/^(18|13|15)\d{9}$/;
	var reg2=/\w{1,}/
	var flag=false;		
	$(function(){
		
		$.idcode.setCode(); //加载验证码
		 		 
		$("#myform").find("input").on("blur",function(){
		 	if(!($(this).val())){  //空的	
		 		$(this).siblings(".tishi").html("<em></em><span>不能为空</span>");	
		 	}
	 		else{  //非空
	 			if(reg1.test($("#myform").find("#phone").val())){   //手机格式正确
		 			$("#myform").find("#phone").siblings(".tishi").html("");
		 			flag=false;
		 			if($.idcode.validateCode()){  //判断验证码是否正确		 				
		 				flag=true;
		 			}
		 		}
	 			else{  //手机格式错误
	 				$("#myform").find("#phone").siblings(".tishi").html("<em></em><span>手机格式错误</span>");
	 			} 				 		
		 	}
		})
		 
		 
		$("#myform").find("input").on("focus",function(){
		 	if(!($(this).val())){	
		 		$(this).siblings(".tishi").html("");
		 	}
		})
		
		
		$("#btn").on("click", function () {
			console.log($.idcode.validateCode());
		 	//复选框被选中的情况下
		 	if($("#checkbox").prop("checked")&&flag){		 		
		 		$.ajax({
		 			type:"post",
		 			url:"../php/zhuce.php",
		 			async:true,
		 			data:{
		 				uname:uname.value,
		 				upwd:upwd.value,
		 				phone:phone.value
		 			},
		 			dataType:"json",		 			
		 			success:function(res){	 				
		 				console.log(res);
		 				alert(res.msg);		 				
		 				if(res.status==1){
		 					window.location.href="login.html";
		 				}
		 			}
		 		})
			 	
		 	}
		})
	})	 			 			 		 			
</script>
